<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title></title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">PAPN</h1>

            </div>
            <h3>欢迎使用 PAPN体重管理后台</h3>

            <form class="m-t" role="form" action="index.html">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="用户名" required="" id="name">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="密码" required="" id="pwd">
                </div>
                <button type="button" class="btn btn-primary block full-width m-b" id="submitBtn">登 录</button>
                <!--<p class="text-muted text-center"> <a href="login.html#"><small>忘记密码了？</small></a> | <a href="register.html">注册一个新账号</a>&ndash;&gt;-->
                <!--</p>-->

            </form>
        </div>
    </div>

    <!-- 全局js -->
    <script src="js/jquery.min.js?v=2.1.4"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
    <!--自定义js-->
    <script>
       $('#submitBtn').click(function(){
           var $name = $('#name').val();
           var $pwd = $('#pwd').val();
           if($name == ''){
               alert('请填写用户名');
           }else if($pwd == ''){
               alert('请填写密码');
           }else{
               $.ajax({
                   url:'https://mdn.tfnhg.com/admin_denglu',
                   type:'POST',
                   data:{
                       user_name:$name,
                       user_password:$pwd
                   },
                   success(res){
                       // console.log(typeof(res));
                       var res = JSON.parse(res)
                       // console.log(res);
                       sessionStorage.setItem('status',res.status)
                       setTimeout(function(){
                           location.href = 'index.html'
                       },1000)
                   }
               })
           }
       })
    </script>

</body>

</html>
